{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!--BOOK_INFORMATION-->\n",
    "<img align=\"left\" style=\"padding-right:10px;\" src=\"figures/PHydro-cover-small.png\">\n",
    "*This is the Jupyter notebook version of the [Python in Hydrology](http://www.greenteapress.com/pythonhydro/pythonhydro.html) by Sat Kumar Tomer.*\n",
    "*Source code is available at [code.google.com](https://code.google.com/archive/p/python-in-hydrology/source).*\n",
    "\n",
    "*The book is available under the [GNU Free Documentation License](http://www.gnu.org/copyleft/fdl.html). If you have comments, corrections or suggestions, please send email to satkumartomer@gmail.com.*"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!--NAVIGATION-->\n",
    "< [Integration](09.01-Integration.ipynb) | [Contents](Index.ipynb) | [Parameter Estimation](09.03-Parameter-Estimation.ipynb) >"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 9.2 ODE\n",
    "\n",
    "让我们解常微分方程，给出为:\n",
    "\n",
    "<center>$\\frac{dy}{dt}=-xt\\quad\\quad\\quad\\quad\\quad(9.1)$</center>\n",
    "\n",
    "有，\n",
    "\n",
    "<center>$y_0=10\\quad\\quad\\quad\\quad\\quad(9.2)$</center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "首先，我们可以导入所需的库。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from scipy import integrate\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "现在，我们定义我们的函数，以及我们想要这个解决方案的定时器。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "y1 = lambda x,t:-x*t\n",
    "t = np.linspace(0,10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "现在，我们可以使用`integrate.odeint`来解常微分方程。然后，我们可以绘制该解对时间求导的图形。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEKCAYAAAAfGVI8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAGZFJREFUeJzt3XuQlfWd5/H395zupukGmr5xaRpoaGgUUYRpgUaFREPUxNsmtRvNmHF347AXk2gyk1SSmprUVk1lU9lUJmZ3NiWrZjLjfdVNjCZqViNERaQR5CIKyLWxgYbm0tBA3777Rx8dZLk25zy/c87zeVV1nQsPPJ9TNHz6+f2e5/mZuyMiIvGVCB1ARETCUhGIiMScikBEJOZUBCIiMaciEBGJORWBiEjMqQhERGJORSAiEnMqAhGRmCsIHeBcVFVVeV1dXegYIiI5ZcWKFXvdvfps2+VEEdTV1dHc3Bw6hohITjGzbeeynYaGRERiTkUgIhJzKgIRkZhTEYiIxJyKQEQk5jJWBGb2kJntMbO1J7xXYWZ/MLONqcfyTO1fRETOTSaPCP4RuP6k974LvOzuk4GXU69FRCSgjBWBuy8B2k96+xbgV6nnvwJuzdT+AZ5b/SG/XrkTLccpInJ6Uc8RjHT3VoDU44jTbWhmC82s2cya29raBrSzp1e0cO8Tq/jLf2pm18FjA0ssIpLnsnay2N0XuXujuzdWV5/1CulTeuDOK/ibz1/Ma5v2suDvF/Pk8h06OhAROUnURbDbzEYDpB73ZHJnyYRx19UTeeGeeUwdPYzvPL2av3joLXa0d2ZytyIiOSXqIngWuDP1/E7gN1HstK6qlMf+cg5/d+s03t62n+t+toTH3toexa5FRLJeJk8ffQxYCkwxsxYz+yrwI2CBmW0EFqReRyKRMO6YM56XvjWfmePK+d4za3hnx4Godi8ikrUsF8bMGxsbPZ13H+041s38//YqU0cP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Ym3fB4aEhGRc6AiEBGJORWBiEjMqQhERGJORSAiEnMqAhGRmFMRiIjEnIpAZADM7AozW21mxWZWmrpX/rTQuUQGQheUiQyQmf0dUAwMpv/+P/81cCSRAVERiAxQ6hYPy4FjwFx37w0cSWRANDQkMnAVwBBgKP1HBiI5SUcEIgNkZs/Sf/vrCcBod/9a4EgiA5K3dx8VySQz+wugx90fTa2P/YaZXePur4TOJnK+dEQgIhJzmiMQEYk5FYGISMypCEREYk5FICIScyoCEZGYUxGIiMScikBEJOZUBCIiMff/AAn4mJmD7NW+AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1263641ab00>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "y = integrate.odeint(y1,10,t)\n",
    "#plot\n",
    "plt.plot(t,y)\n",
    "plt.xlabel('x')\n",
    "plt.ylabel('y')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<center>图9.1:y随时间的变化</center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "让我们，解一个常微分方程系统给出为，\n",
    "\n",
    "<center>$\\frac{dx}{dt}=Ax\\quad\\quad\\quad\\quad(9.3)$</center>\n",
    "\n",
    "其中，\n",
    "\\begin{equation*}\n",
    "A=\\begin{bmatrix} -D_1 & D_1 & 0 \\\\D_1 & -D_1-D_2 & D_2 \\\\0 & D_2 & -D_3\\end{bmatrix}\\quad\\quad\\quad\\quad(9.4)\n",
    "\\end{equation*}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "我们从定义参数和A矩阵开始。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "D = [0.2,0.2,0.3]\n",
    "A = np.array([[D[0],-D[0],0],\n",
    "              [D[0],-D[0]-D[1],D[1]],\n",
    "              [0,D[2],-D[2]]])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "现在，我们可以定义我们的函数$\\frac{dx}{dt}$。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def dX_dt(sm,t=0):\n",
    "    return np.dot(A,sm)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "最终，我们定义时间，初始化条件，使用`integrate.odeint`来解，然后作图。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEKCAYAAAAfGVI8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAIABJREFUeJzt3Xd8lHW69/HPNT29BwIBAkoRUAGjYAELq3KURdf26FnLrng4a+9H3bNH3ON6dMVddX30+Nh13dV1lVV0LSj2QhNRqVKkBEISUkid/nv+uCchQQIImbmTzPV+ve7XXWd+11DmO3f73WKMQSmlVPJy2F2AUkope2kQKKVUktMgUEqpJKdBoJRSSU6DQCmlkpwGgVJKJTkNAqWUSnIaBEopleQ0CJRSKsm57C5gX+Tn55uSkhK7y1BKqR7lyy+/3G6MKdjbdj0iCEpKSli8eLHdZSilVI8iIhv3ZTs9NKSUUklOg0AppZKcBoFSSiW5HnGOQCml4ikUClFWVobf77e7lP3i8/koLi7G7Xbv1+s1CJRSSa+srIyMjAxKSkoQEbvL+VGMMVRXV1NWVsbgwYP36z3idmhIRAaIyAcislJElovItbHluSLyroisiY1z4lWDUkrtC7/fT15eXo8LAQARIS8v74D2ZuJ5jiAM3GiMOQSYAFwpIiOBW4F5xpihwLzYvFJK2aonhkCrA609bkFgjCk3xiyJTTcAK4H+wBnAs7HNngXOjFcNi7Yt4olvn4jX2yulVK+QkKuGRKQEG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UjTGbAM2i8jw2KLJwAobS0qETcAEEUmN/RufTC8/Qd7OHOCS2PQlwGvxaMQVjzftDowxYRG5CngH6yqDp4wxy20uK96OBS4CvhWRpbFlvzbGvGljTarrXQ38JfYDZz3wS5vriStjzAIReRlYgnVl3Ff0wjuMReQF4AQgX0TKgJnAPcBLIjIdKxDPjUvbemexUkolt958aEgppdQ+0CBQSqkkp0GglFJJToNAKaWSnAaBUkoluV57+ahS+0NE8rA69wLoC0SwunQAaDbGJMuNTCqJ6OWjSnVCRO4AGo0x99ldi1LxpIeGlNpHItIYG58gIh+JyEsi8p2I3CMiPxeRhSLyrYgcFNuuQEReEZFFseFYez+BUrunQaDU/jkc6zkIh2LdzT3MGHMUVnfYV8e2eRC43xhzJHA2SdJVtup59ByBUvtnUWv3wCKyDmjtFvlb4MTY9E+AkVb3OABkikhG7FkRSnUbGgRK7Z9Au+lou/koO/9fOYCjjTEtiSxMqR9LDw0pFT9zgataZ0RkjI21KNUpDQKl4ucaoFREvhGRFcCv7C5Iqd3Ry0eVUirJ6R6BUkolOQ0CpZRKchoESimV5DQIlFIqyWkQKKVUktMgUEqpJKdBoJRSSU6DQCmlktz/B0N2BrvaWjZfAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x126367b6470>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "t = np.linspace(0,10,100)\n",
    "X0 = np.array([10,5,20])\n",
    "X,infodict = integrate.odeint(dX_dt,X0,t,full_output=True)\n",
    "\n",
    "plt.plot(t,X)\n",
    "plt.xlabel('Time')\n",
    "plt.ylabel('X')\n",
    "plt.legend(['X1','X2','X3'])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<center>图9.2:x随着时间的变化</center>"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
